package com.xf.micro.core.filter;

import com.xf.micro.core.filter.context.FilterContext;

/**
 * @author zouxf
 * @date 2023/12/26 16:30
 * @description
 */

public abstract class LinkedCoreFilter implements CoreFilter{

    private LinkedCoreFilter next;

    public void boot() {

    }

    public LinkedCoreFilter getNext() {
        return next;
    }

    public void setNext(LinkedCoreFilter next) {
        this.next = next;
    }

    public void fireNext(FilterContext filterContext) {

        if (next != null) {
            next.doFilter(filterContext);
        }else {
            System.out.println("已到达过滤器链尾部");
        }
    }
}
